Various forms of computer languages and compilers have been developed for the creation, compilation and execution of code segments, sometimes known as "class files," which contain bytecode and data. Such languages include the JAVA language developed by Sun Microsystems, Inc. of Palo Alto, Calif., and the various dialects of that language that have been developed. These computer languages offer the advantages of allowing the creation of code segments that can be stored on a server computer system and transferred from the server computer system to a remote computer system at a desired time. The remote computer system can receive the code segment and execute it locally.
A common use of such code segments is in the transmission of executable code via a remote electronic communications network, such as the Internet or its components, such as the World Wide Web. For example, a server computer or web site can be contacted by a remote user computer system by specifying a world wide web "address." The user system receives the bytecode by transmission over the computer network. The user system executes an interpreter, such as a JAVA interpreter or other software containing appropriate code for receiving and executing the bytecode.
One disadvantage of such known computer languages is that the transmitted code segments often contain unnecessary code and/or data, making the code segment longer and making transmission and execution of the code segment more burdensome. A longer code segment naturally takes longer to transmit via a computer network than one which is shorter. For example, the code segment may contain methods or fields which are not actually required for execution in the user or destination computer system. The code segment may also contain repetitive use of particular classes, methods or fields or other code.
In operation, received code segments typically are stored in memory in the user or destination system. The memory may include a non-volatile storage medium such as a hard disk or writable CD-ROM or volatile memory such as RAM (random access memory). Because the code segments may include unneeded components or multiple instances of the same component, they may require an excessive amount of such memory storage. Furthermore, the longer code will also entail longer access and execution times.
The JAVA language and associated interpreters are widely known. Code segments, or class files, generated using JAVA contain method definitions and field specifications. Objects, which are instances of classes, are collections of fields and methods that operate on fields. Methods may call each other via invocations and objects may pass data among each other via methods, such as for private fields, or via direct field references, such as for public fields.
A method is code used to perform a particular task, such as modifying data in some way, such as for performing a procedure or a function.
Fields are components of objects in which object data are stored such as integers or characters, i.e., variables. Data may be designated as public or private. Private data is generally accessible by a single class while public data is accessible by multiple classes.
Data may also be characterized as static or instance data. Static data is associated with each class, whereas instance data is associated with each object, or instance of a class. In a typical JAVA code implementation, a class file is read by the interpreter and executed according to the meaning of the code within the class file.
There is a need for a system and method for compressing bytecode or code segments and for interpreting and executing such compressed code.